<?php
require(dirname(__FILE__) .'/check.php');
$skin->CheckIframe();



// 用户检测
$MB->Open('','login');


switch ($mudi){
	case 'dayDel':
		$menuFileID = 528;
		$MB->IsSecMenuRight('alertBack',$menuFileID,$dataType);
		DayDel();
		break;

	default:
		die('err');
}

$MB->Close();
$DB->Close();





// 按天数删除
function DayDel(){
	global $DB;

	$backURL= OT::GetStr('backURL');
	$day	= OT::GetInt('day');

	if ($day < 2){
		JS::AlertBackEnd('天数指定错误.');
	}
	$day = $day*(-1);

	$DB->query('delete from '. OT_dbPref .'userLog where UL_time<'. $DB->ForTime(TimeDate::Add('d',$day,TimeDate::Get())));

	JS::AlertHref('删除成功.',$backURL);

}
?>